<template>
  <div>
    <mt-swipe :auto="4000">
      <mt-swipe-item v-for="item in people" v-bind:key="item.name">姓名：{{item.name}}，年龄：{{item.age}}</mt-swipe-item>
    </mt-swipe>
    <button @click="update">更新数据</button>
  </div>

</template>

<script>
  export default {
    data () {
      return {
        people:[]
      }
    },
    created: function () {
      // `this` 指向 vm 实例
      this.get();
    },
    methods: {
      get: function () {
        //发送get请求
        this.$http.get('./static/a.json').then(function (res) {
           //this.people=this.people.concat(res.body);
          this.people=res.body
        }, function () {
          console.log('请求失败处理')
        })
      },
      update:function () {
        this.people[0]['name']="xcyxcyxcy"
      }

    }
  }
</script>

<style scoped>
  .mint-swipe{
    height: 200px;
  }
  .mint-swipe-item{
    background-color: #42b983;
  }
</style>
